using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Configuration;

using IDAL;
using Entities;

namespace Bll
{
    public class OrderBll
    {
        public IList<OrderInfo> GetAll()
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetAll();
        }

        public OrderInfo GetByOrderID(string orderID)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetByOrderID(orderID);
        }

        public int Insert(OrderInfo order)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.Insert(order);
        }

        public bool UpdateShippedDate(string orderID)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.UpdateShippedDate(orderID);
        }
        public IList<OrderInfo> GetByOrderDate()
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetByOrderDate();
        }
        public IList<OrderInfo> GetOrderBetweenDay(string from, string to)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetOrderBetweenDay(from, to);
        }
        public IList<OrderInfo> GetByUserName(string username)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetByUserName(username);
        }
        public string GetTotalOrderByOrderDay()
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetTotalOrderByOrderDay();
        }
        public string GetTotalOrderBetWeenDay(string from, string to)
        {
            IOrderDAO iOrder = (IOrderDAO)AssemblyLoader.Load("OrderDAO");
            return iOrder.GetTotalOrderBetWeenDay(from, to);
        }
    }
}
